-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ Issue 548 ] Production Cert for Simpler Domain #557
Conversation
Here's the results from running This was the prod output:
|
infra/frontend/service/main.tf
Outdated
cert_arn = ( | ||
terraform.workspace != "default" ? null : | ||
var.environment_name == "prod" ? data.aws_acm_certificate.frontend_prod_cert.arn : | ||
data.aws_acm_certificate.frontend_dev_cert.arn | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cert_arn = ( | |
terraform.workspace != "default" ? null : | |
var.environment_name == "prod" ? data.aws_acm_certificate.frontend_prod_cert.arn : | |
data.aws_acm_certificate.frontend_dev_cert.arn | |
) | |
# Temporary to avoid issues if Terratest if workspace is default and pass correct environment cert | |
cert_arn = ( | |
terraform.workspace != "default" ? null : | |
(var.environment_name == "prod" ? data.aws_acm_certificate.frontend_prod_cert.arn : | |
data.aws_acm_certificate.frontend_dev_cert.arn) | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listing some ideas to simplify this ternary if you want, encapsulating all the thoughts of the day:
Option 1: Put the domains into a map in /app-config/main.ts
locals and use it in env_config
module to pass the correct environment's domain name to service.
Option 2: Put domain name in dev.tfvars
and prod.tfvars
😆 I totally forgot these existed.
For example, in dev.tfvars
domain_name = "beta.grants.gov"
Then in service use it as var.domain_name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the ternary, and it'll get uglier when/if we add staging, but 🚢.
Thanks for your patience as I think out possible solutions to simplifying the ternary. I distilled all the thoughts down into one comment and happy to continue to work on implementing that with you if you'd like.
Thanks for the pairing and discussion both on and off github @daphnegold! I updated it to use the tfvars file so it's much cleaner now and we can set the domains in a much more reasonable place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love that there's no need to check for default workspace to avoid Terratest issues now. You got rid of all the yuck, nice going.
Summary
Fixes #548
Time to review: 5 mins
Changes proposed